package com.rshare.cloud.rspub.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import httl.web.springmvc.HttlViewResolver;

/**
 * 标题、简要说明. <br>
 * 类详细说明.
 * <p>
 * Copyright: Copyright (c) 2017年4月26日 上午10:57:15
 * <p>
 * Company: 苏州罗想软件有限公司
 * <p>
 * 
 * @author yi.zhang@roadshare.com
 * @version 1.0.0
 */
@Configuration
//@ComponentScan(basePackages={"com.rshare.cloud.rspub.**.ctrl"})
public class WebConfig {

//	 @Bean
//	 public FreeMarkerViewResolver freeMarkerViewResolver() {
//	 FreeMarkerViewResolver resolver = new FreeMarkerViewResolver();
//	 resolver.setCache(false);
//	 resolver.setPrefix("");
//	 resolver.setSuffix(".html");
//	 resolver.setContentType("text/html; charset=UTF-8");
//	 resolver.setExposeSessionAttributes(true);
//	 resolver.setRequestContextAttribute("request");
//	 return resolver;
//	 }

	// @Bean
	// public MyWebMvcConfigAdapter getMyWebMvcConfigAdapter(){
	// return new MyWebMvcConfigAdapter();
	// }

//	@Bean
//	public HttlViewResolverForBoot httlViewResolver()
//	{
//		HttlViewResolverForBoot resolver = new HttlViewResolverForBoot();
//		resolver.setCache(false);
//		resolver.setPrefix("");
//		resolver.setSuffix(".httl");
//		resolver.setContentType("text/html; charset=UTF-8");
//		resolver.setExposeSessionAttributes(true);
////		resolver.setRequestContextAttribute("request");
//		return resolver;
//	}
	
	@Bean
	public HttlViewResolver httlViewResolver()
	{
		HttlViewResolver resolver = new HttlViewResolver();
		resolver.setCache(false);
		resolver.setPrefix("");
		resolver.setSuffix(".httl");
		resolver.setContentType("text/html; charset=UTF-8");
		resolver.setExposeSessionAttributes(true);
//		resolver.setRequestContextAttribute("request");
		return resolver;
	}
	
}
